<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>center-行内元素居中</title>
    <style>
        div {
            text-align: center;
        }
    </style>
</head>
<body>
<div><span>这里要水平居中显示.</span></div>
</body>
</html>